package operations;

import aboutTheBook.BookShelf;
import aboutTheBook.Book;

public class Show implements IOperation,ICheckIsEmpty{
    @Override
    public boolean checkIsEmpty(BookShelf bookShelf) {
        return bookShelf.getSize()==0;
    }
    @Override
    public void work(BookShelf bookShelf) {
        //展示所有图书
        //1：判空
        if(checkIsEmpty(bookShelf)) {
            return;
        }
        //2：不为空直接打印
        Book[] bookList = bookShelf.getBookList();
        for(int i = 0; i < bookShelf.getSize(); i++) {
            System.out.println(bookList[i]);
        }
    }
}